package com.jike.noobmoney.adapter;


import android.content.Context;

import com.jike.noobmoney.R;
import com.jike.noobmoney.entity.ShouZhiEntity;


/**
 * Created by kekex on 2018/9/8.
 * 我的任务的列表adapter
 */

public class ShouZhiListAdapter extends BaseRecyclerAdapter<ShouZhiEntity.UsermoneyBean> {


    private Context context;

    public ShouZhiListAdapter(Context context) {

        super(R.layout.item_shou_zhi_list);
        this.context = context;

    }

    @Override
    protected void onBindViewHolder(SmartViewHolder holder, ShouZhiEntity.UsermoneyBean item, int position) {

        holder.text(R.id.tv_shouzhi_content, item.getInfo());
        int type = item.getType();
        String fuhao = type == 5 || type == 8 ? "-" : "+";
        if(fuhao.equals("+")){
            holder.textColorId(R.id.tv_shouzhi_money,R.color.tab_color);
        }else
        {
            holder.textColorId(R.id.tv_shouzhi_money,R.color.notice_color);
        }
        holder.text(R.id.tv_shouzhi_money, fuhao + item.getMoney() + "元");

        holder.text(R.id.tv_shouzhi_time, item.getCreatetime());

    }
}
